package xipujewel.xipujewel.web.account;

import javax.servlet.ServletRequest;

import net.esoar.modules.web.BaseController;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import xipujewel.xipujewel.entity.account.User;
import xipujewel.xipujewel.entity.app.PriceBaseNumber;
import xipujewel.xipujewel.service.PriceBaseNumberManager;
import xipujewel.xipujewel.service.account.UserManager;
import xipujewel.xipujewel.utils.UserUtil;

/**
 * 
 * @author hang
 *
 */
@Controller
@RequestMapping(value = "/priceBaseNumber")
public class PriceBaseNumberController extends BaseController<PriceBaseNumber> {

	@Autowired
	private PriceBaseNumberManager priceBaseNumberManager;

	@Autowired
	private UserManager userManager;

	@RequestMapping("")
	public String getPriceBaseNumber(Model model, ServletRequest request) {
		String loginName = UserUtil.getCurrentUserLoginName();
		User user = userManager.findByLoginNameAndType01(loginName);
		PriceBaseNumber priceBaseNumber = user.getPriceBaseNumber();
		model.addAttribute("priceBaseNumber", priceBaseNumber);
		return "priceBaseNumber/priceBaseNumber";
	}

	@Override
	public String baseMapping() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public String getModelName() {
		// TODO Auto-generated method stub
		return null;
	}

}
